<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./lib/echarts.min.js"></script>
    <div id="main" style="width: 800px; height: 600px"></div>
    <script>
      const myEcharts = echarts.init(document.getElementById('main'))
      const option = {
        title: {
          text: '孙明月 19组',
        },
        xAxis: {
          type: 'category',

          axisLine: {
            lineStyle: {
              type: 'dashed',
              // color: 'red',
            },
          },

          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
          axisLabel: {
            color: 'red',
          },
        },
        yAxis: {
          type: 'value',
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar',
            showBackground: true,
            backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)',
            },
            itemStyle: {
              color: {
                x: 0.8,
                y: 0.8,
                colorStops: [
                  {
                    offset: 0,
                    color: '#f4c1cd', // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: '#94cce7', // 100% 处的颜色
                  },
                ],
                global: false, // 缺省为 false
              },
            },
          },

          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar',
            showBackground: true,
            backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)',
            },
            itemStyle: {
              color: {
                type: 'radial',
                x: 0.5,
                y: 0.5,
                r: 0.5,
                colorStops: [
                  {
                    offset: 0,
                    color: '#ffb1bc', // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: '#ff0000', // 100% 处的颜色
                  },
                ],
                global: false, // 缺省为 false
              },
            },
          },
        ],
      }
      myEcharts.setOption(option)
    </script>
  </body>
</html>
